﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - My ASP.NET MVC Application</title>
     <link href="@Url.Content("~/Content/themes/base/CarrouselStyle.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
   
    <link href="@Url.Content("~/Content/themes/base/WaterMark.css")" rel="stylesheet" type="text/css" />
    <meta name="viewport" content="width=device-width">
</head>
<body>
    <header>
        <div class="content-wrapper">
            <div class="float-left">
                <p class="site-title">@Html.ActionLink("VideoClub Gorbea", "Index", "Home")</p>
            </div>
            <div class="float-right">
                <section id="login">
                    @Html.Partial("_LogOnPartial")
                </section>
                <nav>
                    <ul id="menu">
                        <li>@Html.TextBox("movies", null, new { @class = "txt", @title = "Search Movies..." })</li>
                        <li><a href="@Url.Action("Index","Home")" data-ajax="true" >Home</a> </li>
                        <li>@Html.ActionLink("About", "About", "Home")</li>
                        <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                    </ul>
                </nav>
            </div>
        </div>
    </header>
    <div id="body">
        @RenderSection("featured", false)
        <section class="content-wrapper main-content clear-fix">
            @RenderBody()
        </section>
    </div>
    <footer>
        <div class="content-wrapper">
            <div class="float-left">
                <p>
                    &copy; @DateTime.Now.Year - My ASP.NET MVC Application</p>
            </div>
            <div class="float-right">
                <ul id="social">
                    <li><a href="http://facebook.com" class="facebook">Facebook</a></li>
                    <li><a href="http://twitter.com" class="twitter">Twitter</a></li>
                </ul>
            </div>
        </div>
        <script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/knockout-1.3.0beta.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/Carrosuel.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/AjaxLogin.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/jquery.updnWatermark.js")" type="text/javascript"></script>
        <script>
            var cont = 0;
            $('slideshow').style.display = 'none';
            $('wrapper').style.display = 'block';
            var slideshow = new TINY.slideshow("slideshow");
            window.onload = function () {
                slideshow.auto = true;
                slideshow.speed = 5;
                slideshow.link = "linkhover";
                slideshow.info = "information";
                slideshow.thumbs = "slider";
                slideshow.left = "slideleft";
                slideshow.right = "slideright";
                slideshow.scrollSpeed = 4;
                slideshow.spacing = 5;
                slideshow.active = "#fff";
                slideshow.init("slideshow", "image", "imgprev", "imgnext", "imglink");
            }

            $(document).ready(function () {
                $.updnWatermark.attachAll();

                bindLinks();
                bindLessMovies();
                bindMoreMovies();

                $("#movies").autocomplete({ delay: 80 }, { minLength: 3 },
                {
                    source: '@Url.Action("SearchMovies", "Home")',
                    select: function (event, ui) {
                        $("#movieID").val(ui.item.Title);
                    }
                });

            });

            function bindLessMovies() {
                $("a[data-lessMovies]").each(function () {
                    $(this).click(function (evt) {
                        evt.preventDefault();
                        if (cont - 10 < 0) {
                            cont = 0
                        }else {
                            cont -= 10;
                        }
                        ajaxload($(this).attr("href"), true);
                    });
                });
            }

            function bindMoreMovies() {
                $("a[data-moreMovies]").each(function () {
                    $(this).click(function (evt) {
                        evt.preventDefault();
                        var len = $("#source > ol").length;
                        if (len > 0) {
                            cont += 10;
                            ajaxload($(this).attr("href"), true);
                        }
                    });
                });
            }

            function bindLinks() {
                $("a[data-ajax]").each(function () {
                    $(this).click(function (evt) {
                        evt.preventDefault();
                        ajaxload($(this).attr("href"), true);
                    });
                });
            }

            function ajaxload(url, add) {
                url = url + '/' + cont;
                $("#source").load(url, function () {

                });
            }
            $(function () {
                $('#carousel').infiniteCarousel({
                    displayTime: 6000,
                    textholderHeight: .25
                });
            });

</script>
    </footer>
</body>
</html>
